﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
using UnityEngine.UI;
public class MoneyMove : MonoBehaviour {

    private TurretBuild tB;
    [SerializeField]
    public Transform target;
   
   
    // Use this for initialization
    void Start () {
        
        tB = GameObject.Find("GameManager").GetComponent<TurretBuild>();
        target = GameObject.Find("MoneyMask").transform;
       


    }

    public void Move()
    {
        transform.DOMove(new Vector3(target.position.x, target.position.y, 0), 1.5f).SetEase(Ease.InExpo);

        Invoke("HideGainMoney", 1.51f);
       
    }
    public void HideGainMoney()
    {
        transform.gameObject.SetActive(false);
    }


}
